package com.ds.dsm.view.config.grid;

import com.ds.dsm.view.config.action.CustomBuildAction;
import com.ds.dsm.view.config.service.GridConfigService;
import com.ds.esd.custom.annotation.CustomAnnotation;
import com.ds.esd.custom.annotation.FieldAnnotation;
import com.ds.esd.custom.form.annotation.FormAnnotation;
import com.ds.esd.custom.form.enums.CustomFormMenu;
import com.ds.esd.custom.grid.CustomGridViewBean;
import com.ds.esd.custom.toolbar.BottomBarMenu;
import com.ds.esd.tool.ui.enums.TagCmdsAlign;


@BottomBarMenu(menuClass = CustomBuildAction.class)
@FormAnnotation(col = 1,
        bottombarMenu = {CustomFormMenu.Save, CustomFormMenu.ReSet}, customService = GridConfigService.class)
public class GridBaseView {


    @CustomAnnotation(hidden = true, pid = true)
    String viewInstId;

    @CustomAnnotation(hidden = true, pid = true)
    String domainId;

    @CustomAnnotation(hidden = true, pid = true)
    String sourceClassName;

    @CustomAnnotation(hidden = true, pid = true)
    String entityClassName;


    @CustomAnnotation(hidden = true, uid = true)
    String methodName;

    @FieldAnnotation(rowHeight = "50")
    @CustomAnnotation(caption = "行高")
    String rowHeight;


    @CustomAnnotation(caption = "显示表头")
    Boolean showHeader;

    @CustomAnnotation(caption = "分色显示")
    Boolean altRowsBg;

    @CustomAnnotation(caption = "命令按钮位置")
    TagCmdsAlign tagCmdsAlign;


    public GridBaseView() {

    }

    public GridBaseView(CustomGridViewBean gridConfig) {
        if (gridConfig == null) {
            gridConfig = new CustomGridViewBean();

        }
        this.methodName = gridConfig.getMethodName();
        this.entityClassName = gridConfig.getEntityClassName();
        this.showHeader = gridConfig.getShowHeader();
        this.rowHeight = gridConfig.getRowHeight();
        this.viewInstId = gridConfig.getViewInstId();
        this.domainId = gridConfig.getDomainId();
        this.sourceClassName = gridConfig.getSourceClassName();
        this.altRowsBg = gridConfig.getAltRowsBg();

    }

    public String getDomainId() {
        return domainId;
    }

    public void setDomainId(String domainId) {
        this.domainId = domainId;
    }


    public String getRowHeight() {
        return rowHeight;
    }

    public void setRowHeight(String rowHeight) {
        this.rowHeight = rowHeight;
    }

    public Boolean getAltRowsBg() {
        return altRowsBg;
    }

    public void setAltRowsBg(Boolean altRowsBg) {
        this.altRowsBg = altRowsBg;
    }

    public String getViewInstId() {
        return viewInstId;
    }

    public void setViewInstId(String viewInstId) {
        this.viewInstId = viewInstId;
    }

    public Boolean getShowHeader() {
        return showHeader;
    }

    public void setShowHeader(Boolean showHeader) {
        this.showHeader = showHeader;
    }

    public String getSourceClassName() {
        return sourceClassName;
    }

    public void setSourceClassName(String sourceClassName) {
        this.sourceClassName = sourceClassName;
    }

    public String getEntityClassName() {
        return entityClassName;
    }

    public void setEntityClassName(String entityClassName) {
        this.entityClassName = entityClassName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public TagCmdsAlign getTagCmdsAlign() {
        return tagCmdsAlign;
    }

    public void setTagCmdsAlign(TagCmdsAlign tagCmdsAlign) {
        this.tagCmdsAlign = tagCmdsAlign;
    }
}
